package com.unidt.www.module.third.enterprise.dao;

import com.unidt.www.framework.mybatis.core.mapper.BaseMapperX;
import com.unidt.www.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.unidt.www.module.third.enterprise.domain.SystemUserEnterpriseDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 * 部门表 Mapper 接口
 * </p>
 *
 * @author ouyangoyys
 * @since 2022-11-24
 */
@Mapper
public interface SystemUserEnterpriseMapper extends BaseMapperX<SystemUserEnterpriseDO>{


    default List<SystemUserEnterpriseDO> selectByUserId(Long userId) {
        return selectList(new LambdaQueryWrapperX<SystemUserEnterpriseDO>()
                .eqIfPresent(SystemUserEnterpriseDO::getUserId,userId)
                .eqIfPresent(SystemUserEnterpriseDO::getDeleted,0)
        );
    }
}
